package com.kqkj.dyrule.marketing.utils;

import org.apache.commons.lang.time.DateUtils;

import java.util.Calendar;
import java.util.Date;

/**
 * 分段查询辅助工具
 */
public class CrossTimeQueryUtil {

    /**
     * 给定时间向上取整，倒退2小时
     * @return
     */
    public static long getSegmentPoint(long timeStamp){

        Date dt = DateUtils.ceiling(new Date(timeStamp - 2 * 60 * 60 * 1000), Calendar.HOUR);
        return dt.getTime();
    }
}
